package dev.alm.xiaotuxianservice.controller;

import dev.alm.xiaotuxianservice.common.CommonReq;
import dev.alm.xiaotuxianservice.common.CommonRes;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
public class TestController {

    @PostMapping("hello")
    public CommonRes hello(@RequestBody CommonReq req) {
        String userId = req.getUserId();
        String message = "hello " + userId;
        CommonRes res = new CommonRes();
        res.setMessage(message);
        res.setCode(200);
        return res;
    }

}
